
<legend>RECIBO DE PAGOS</legend>
<form name="forma" class="well form-horizontal span8" action="<?php echo base_url() . "admin.php/recibo/ingresodatos" ?>" method="post" >
    <div class="control-group">
        <label class="control-label" for="input01">N&uacute;mero del Recibo</label>
        <div class="controls">
            <!--<input type="text" class="input-medium span2"  name="recibo" value= "<?php echo $nro_recibo; ?>"disabled> -->

        </div>

    </div>

    <input type="hidden" name="id_matr" value="<?php echo $id_matr; ?>">
    <input type="hidden" name="ide_lec" value="<?php echo $ide_lec; ?>">
    <div class="control-group">
        <label class="control-label" for="input01">N&uacute;mero de Identificaci&oacute;n</label>
        <div class="controls">
            <input type="text" class="input-medium span2"  name="cedula" value= "<?php echo $cedula_pers; ?>"disabled>

        </div>

    </div>
    <input type="hidden" name="cedula_pers" value="<?php echo $cedula_pers; ?>">

    <div class="control-group">
        <label class="control-label" for="input02">Apellidos y Nombres </label>
        <div class="controls">
            <input type="text" class="input-medium span4"  name="nombres" value= "<?php echo ($apellido_pers . "  " . $nombre_pers); ?>" disabled>

        </div>
    </div>
    <input type="hidden" name="nombre_pers" value="<?php echo ($apellido_pers . "  " . $nombre_pers); ?>">






    <div class="control-group">
        <label class="control-label" for="input06">Direccion del Domicilio</label>
        <div class="controls">
            <input type="text" class="input-medium span4"  name="direccion" value= "<?php echo $direccion_pers; ?>"disabled>

        </div>
    </div>
    <input type="hidden" name="direccion_pers" value="<?php echo $direccion_pers; ?>">


    <div class="control-group">
        <label class="control-label" for="select03">Fecha de Pago</label>
        <div class="controls">
            <input type="text" class="input-medium "  name="fecha_pago" value="<?php echo date('Y-m-d'); ?>" disabled>

        </div>
    </div>
    <input type="hidden" name="fecha_nac_pers" value="<?php echo date('Y-m-d'); ?>">

    <div class="control-group">
        <label class="control-label" for="input08">N&uacute;mero de tel&eacute;fono</label>
        <div class="controls">
            <input type="text" class="input-medium span2"  name="fono" value= "<?php $fono_pers; ?>" disabled>

        </div>
    </div>
    <input type="hidden" name="fono_pers" value="<?php $fono_pers; ?>">


    <div class="control-group">
        <label class="control-label" for="input02">PAGO INICIAL</label>
        <div class="controls">
            <input type="text" class="input-medium span2"  id="pago_i" name="monto_canc_matr" value="<?php echo $monto_canc_matr; ?>" readonly="true">

        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="input02">PAGO INICIAL ARRASTRE</label>
        <div class="controls">
            <input type="text" class="input-medium span2"  id="pago_arra" name="pago_inicial" value="<?php echo $pago_inicial; ?>" readonly="true">

        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="input02">HOJA MEMBRETADA</label>
        <div class="controls">
            <input type="text" class="input-medium span2"  id="pago_hoja" name="hoja_valor_lec" value="<?php echo $hoja_valor_lec; ?>" readonly="true">

        </div>
    </div>

    <!--<input type="hidden" name="monto_canc_matr" value="<?php echo $monto_canc_matr; ?>"> -->
     <input type="hidden" name="concepto" value="<?php echo ($concepto); ?>">

    <div class="control-group">
        <label class="control-label" for="input02">TIPO DE DOCUMENTOS</label>
        <div class="controls">
            <select id="select21"  class="span2" name="tipo_doc_pago_mat">
                <?php
                switch ($tipo_doc_pago_mat) {
                    case 1:echo ("<option value='1'>EFECTIVO</option>");
                        break;
                    case 2:echo ("<option value='2'>CHEQUE</option>");
                        break;
                    case 3:echo ("<option value='3'>DEPOSITO</option>");
                        break;
                    case 4:echo ("<option value='4'>TARJETA</option>");
                        break;
                    case 5:echo ("<option value='5'>EFECTIVO-CHEQUE</option>");
                        break;
                    case 6:echo ("<option value='6'>EFECTIVO-DEPOSITO</option>");
                        break;
                    case 7:echo ("<option value='7'>EFECTIVO-TARJETA</option>");
                        break;

                    }
                ?>

            </select>
        </div>
    </div>
    
    <?php 
        session_start() ;
        $out='';
        
        if (isset($_SESSION["ses_pagodoc"]) && count($_SESSION["ses_pagodoc"]) > 0) {
            $pa=$tipo_doc_pago_mat;
            //$nro+=1;
            $out.='<div id="tablaDoc'.($pa).'">';
            $out.='<table class="table table-bordered table-striped tablaVista" style="overflow: auto">';
            $out.='<thead>';
            $out.='<th>Docum/Cta</th><th>Nro Documento</th><th>Ref Documento</th>
                  <th>Fecha documento</th><th>Lote documento</th><th>Valor Doc</th><th>Efectivo</th>';
            $out.='</thead>';
            $out.='<tbody>';
            $total = 0;
            foreach ($_SESSION["ses_pagodoc"] as $item) {
                $out.= '<tr>';
                $out.= '<td>' . $item["doc1"] . '</td>';
                $out.= '<td>' . $item["doc2"] . '</td>';
                $out.= '<td>' . $item["doc3"] . '</td>';
                $out.= '<td>' . $item["doc6"] . '</td>';
                $out.= '<td>' . $item["doc7"] . '</td>';
                //$out.= '<td>' . $item["nro"] . '</td>';
                $out.= '<td>' . $item["doc4"] . '</td>';
                $out.= '<td>' . $item["doc5"] . '</td>';
                $total+=($item["doc4"]+$item["doc5"]);
                $out.= '</tr>';
            }
                $out.= '<tr>';
            $out.= '<td colspan="8"><span style="font-size: 14px">Total:';
            $out.= ' <input type="number" readonly="true" class="input-medium span1"  id="idvalortotdoc" name="valortotdoc" value="'.$total.'"></span></td>';            
            $out.= '</tr>';
            $out.='</tbody>';
            $out.='</table> </div>';
            $out.='<input type="hidden" id="idnrodocredito" name="nro_docredito" value="'.(count($_SESSION["ses_pagodoc"])+1).'">';
        } else {
            $out = 'No existe Ningun documento';
        }
        echo $out;

     ?>



    <input type="hidden" name="pagina" value="<?php echo $pagina; ?>">

    <div class="controls">



        <button type="submit" class="btn" >Grabar Recibo</button>


    </div> 



</form>


